<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.staticfile.org/jquery/3.6.0/jquery.min.js"></script>
</head>
<body>
    <button id="btnGet">GET</button>
    <button id="btnPost">POST</button>

    <script>
        $('#btnGet').on('click',function(){
            $.ajax({
                type:"GET",
                url:'http://localhost:3030/api/get',
                data:{name:'zsh'},
                success:function(res){
                    console.log(res)
                }
            })
        })

        $('#btnPost').on('click',function(){
            $.ajax({
                type:"POST",
                url:'http://localhost:3030/api/post',
                data:{name:'zsh',age:18},
                success:function(res){
                    console.log(res)
                }
            })
        })
    </script>
</body>
</html>